local Lua__weiguo = fk.CreateSkill {

  name = "Lua__weiguo",

  tags = { Skill.Compulsory, Skill.Permanent },

}

Fk:loadTranslationTable{ 
    ["Lua__weiguo"] = "危国",
    [":Lua__weiguo"] = "持恒技，锁定技，你受到伤害后，你依次获得“寸目”，“鼓舌”，“自缚”，“救援”。",
}

Lua__weiguo:addEffect(fk.Damaged, {
    anim_type = "control",
    can_trigger = function(self, event, target, player, data)
        return target == player and player:hasSkill(Lua__weiguo.name) 
        and not (player:hasSkill("ZEcunmu") and player:hasSkill("ZEgushe") and player:hasSkill("ZEzifu") and player:hasSkill("ZEjiuyuan$"))
    end,
    on_use = function(self, event, target, player, data)
        local room = player.room
        -- 根据已有技能数量决定获得哪个技能
        for _, s in ipairs({"ZEcunmu", "ZEgushe", "ZEzifu", "ZEjiuyuan$"}) do
            if not player:hasSkill(s, true) then
                player.room:handleAddLoseSkills(player, s)
                return
            end
        end
    end,
})

return Lua__weiguo